﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media.Imaging;
using System.IO;

namespace Loader
{

    public class patient
    {
        public static int count = 0;
        public patient() {
            admissionDateList.Add("6/11/2011");
            admissionDateList.Add("6/3/2011");
            admissionDateList.Add("6/10/2011");
            admissionDateList.Add("6/19/2011");
            admissionDateList.Add("6/14/2011");
            admissionDateList.Add("6/15/2011");
            admissionDateList.Add("6/4/2011");
            admissionDateList.Add("6/21/2011");
            admissionDateList.Add("6/17/2011");
            admissionDateList.Add("6/10/2011");
            admissionDateList.Add("6/7/2011");
            admissionDateList.Add("6/24/2011");
            lastAsessmentList.Add("7/19/2011");
            lastAsessmentList.Add("7/14/2011");
            lastAsessmentList.Add("7/15/2011");
            lastAsessmentList.Add("7/4/2011");
            lastAsessmentList.Add("7/21/2011");
            lastAsessmentList.Add("7/17/2011");
            lastAsessmentList.Add("7/10/2011");
            lastAsessmentList.Add("7/7/2011");
            lastAsessmentList.Add("7/24/2011");
            lastAsessmentList.Add("7/2/2011");
            lastAsessmentList.Add("7/16/2011");
            lastAsessmentList.Add("7/19/2011");
            latestGameplayList.Add("7/19/2011");
            latestGameplayList.Add("7/14/2011");
            latestGameplayList.Add("7/15/2011");
            latestGameplayList.Add("7/4/2011");
            latestGameplayList.Add("7/21/2011");
            latestGameplayList.Add("7/17/2011");
            latestGameplayList.Add("7/10/2011");
            latestGameplayList.Add("7/7/2011");
            latestGameplayList.Add("7/24/2011");
            latestGameplayList.Add("7/2/2011");
            latestGameplayList.Add("7/16/2011");
            latestGameplayList.Add("7/19/2011");

        }
        public static List<string> admissionDateList = new List<string>();
        public static List<string> lastAsessmentList = new List<string>();
        public static List<string> latestGameplayList = new List<string>();
        public patient(int uid, string lastName, string firstName, string contactNum, string address1, string address2, string postcode, string doc, string e_name, string e_relationship, string e_contactNum, List<string> imagePath, DateTime dateOfBirth, string email, string gender, string contactNumHome, string title, string contactNumWork, string country,int placeID, string e_address1, string e_address2,string e_postalcode, string placeName)
        {
            this.uid = uid;
            this.lastName = lastName;
            this.firstName = firstName;
            this.name = firstName + " " + lastName;
            this.contactNum = contactNum;
            this.address1 = address1;
            this.address2 = address2;
            this.postcode = postcode;
            this.doc = doc;
            this.e_contactNum = e_contactNum;
            this.e_name = e_name;
            this.e_relationship = e_relationship;
            this.e_postalcode = e_postalcode;
            this.imagePath = imagePath;
            //string imagePatch = imagePath[0];
            this.dateOfBirth = dateOfBirth;
            this.email = email;
            this.gender = gender;
            this.contactNumHome = contactNumHome;
            this.title = title;
            this.contactNumWork = contactNumWork;
            this.country = country;
            this.e_address1 = e_address1;
            this.e_address2 = e_address2;
            this.placeID = placeID;
            this.placeName = placeName;
            try
            {
                if (gender.ToLower().Equals("m"))
                {
                    this.image = new BitmapImage(new Uri("Untitled.jpg", UriKind.Relative));
                }
                else if (gender.ToLower().Equals("f"))
                {
                    this.image = new BitmapImage(new Uri("Untitled2.jpg", UriKind.Relative));
                }
            }
            catch (Exception) { }
            //ServiceReference2.Service1Client svc = new ServiceReference2.Service1Client();
            //byte[] imagebyte = svc.retrieveImage(imagePatch);
            //BitmapImage bi = new BitmapImage();
            //bi.BeginInit();
            //bi.StreamSource = new MemoryStream(imagebyte);
            //bi.EndInit();
            //image = bi;
            if (uid == 1)
            {
                this.admission = "6/20/2011";
                this.assessment = "7/7/2011 10:27AM";
                this.latestgameplay = "7/6/2011 02:47PM";
                this.OTNotes = "Ischemic Stroke" + Environment.NewLine + "Post-acute, 7 weeks";
            }
            else
            {
                try
                {
                    this.OTNotes = "Ischemic Stroke";
                    this.admission = admissionDateList[count];
                    this.assessment = lastAsessmentList[count];
                    this.latestgameplay = latestGameplayList[count];
                    count++;
                }
                catch (Exception) { }
            }
            
        }
        private int uid;

        private BitmapImage image;

        public BitmapImage Image
        {
            get { return image; }
            set { image = value; }
        }

        private string OTNotes;

        public string OTNotes1
        {
            get { return OTNotes; }
            set { OTNotes = value; }
        }

        private string assessment;

public string Assessment
{
  get { return assessment; }
  set { assessment = value; }
}

        private string admission;

public string Admission
{
  get { return admission; }
  set { admission = value; }
}

        private string latestgameplay;

public string Latestgameplay
{
  get { return latestgameplay; }
  set { latestgameplay = value; }
}

        private string name;

        public string Name
        {
            get { return name; }
            set { name = value; }
        }


        public int Uid
        {
            get { return uid; }
            set { uid = value; }
        }
        private string lastName;

        public string LastName
        {
            get { return lastName; }
            set { lastName = value; }
        }
        private string firstName;

        public string FirstName
        {
            get { return firstName; }
            set { firstName = value; }
        }
        private int age;

        public int Age
        {
            get { return age; }
            set { age = value; }
        }
        private string contactNum;

        public string ContactNum
        {
            get { return contactNum; }
            set { contactNum = value; }
        }
        private string address1;

        public string Address1
        {
            get { return address1; }
            set { address1 = value; }
        }
        private string address2;

        public string Address2
        {
            get { return address2; }
            set { address2 = value; }
        }
        private string postcode;

        public string Postcode
        {
            get { return postcode; }
            set { postcode = value; }
        }
        private string doc;

        public string Doc
        {
            get { return doc; }
            set { doc = value; }
        }
        private string e_name;

        public string E_name
        {
            get { return e_name; }
            set { e_name = value; }
        }
        private string e_relationship;

        public string E_relationship
        {
            get { return e_relationship; }
            set { e_relationship = value; }
        }
        private string e_contactNum;

        public string E_contactNum
        {
            get { return e_contactNum; }
            set { e_contactNum = value; }
        }
        private List<string> imagePath;

        public List<string> ImagePath
        {
            get { return imagePath; }
            set { imagePath = value; }
        }

        private DateTime dateOfBirth;

        public DateTime DateOfBirth
        {
            get { return dateOfBirth; }
            set { dateOfBirth = value; }
        }

        private string gender;

        public string Gender
        {
            get { return gender; }
            set { gender = value; }
        }

        private string contactNumHome;

        public string ContactNumHome
        {
            get { return contactNumHome; }
            set { contactNumHome = value; }
        }

        private string title;

        public string Title
        {
            get { return title; }
            set { title = value; }
        }

        private string contactNumWork;

        public string ContactNumWork
        {
            get { return contactNumWork; }
            set { contactNumWork = value; }
        }

        private string country;

        public string Country
        {
            get { return country; }
            set { country = value; }
        }

        private string email;

        public string Email
        {
            get { return email; }
            set { email = value; }
        }

        private int placeID;

        public int PlaceID
        {
            get { return placeID; }
            set { placeID = value; }
        }

        private string e_address1;

        public string E_address1
        {
            get { return e_address1; }
            set { e_address1 = value; }
        }

        private string e_address2;

        public string E_address2
        {
            get { return e_address2; }
            set { e_address2 = value; }
        }

        private string e_postalcode;

        public string E_postalcode
        {
            get { return e_postalcode; }
            set { e_postalcode = value; }
        }

        private string placeName;

        public string PlaceName
        {
            get { return placeName; }
            set { placeName = value; }
        }
    }
}
